package main

import "fmt"

type Animal interface {
	getName() string
	setName(name string)
}

type Cat struct {
	name string
}

func (c *Cat) getName() string {
	return c.name
}

func (c *Cat) setName(name string) {
	c.name = name
}

type Dog struct {
	name string
}

func (d *Dog) getName() string {
	return d.name
}

func (d *Dog) setName(name string) {
	d.name = name
}

func main() {

	var animal Animal = new(Cat)
	animal.setName("Cecilia")

	fmt.Println("animal's name is:", animal.getName())

	animal = new(Dog)
	animal.setName("James")
	fmt.Println("animal's name is:", animal.getName())
}

